// 导入
import React from 'react';
import {createRoot} from 'react-dom/client';
import App from './App';
import { BrowserRouter, HashRouter } from 'react-router-dom';
//导入 store 对象
import store from './redux/store';

//创建根元素
let root = createRoot(document.querySelector('#root'));

//根元素渲染
root.render(<App />);

//当 redux 状态发生改变的时候, 重新渲染整个组件
store.subscribe(() => {
  root.render(<App />);
});


